﻿namespace USSDRunner.ViewModels
{
    using System.Linq;

    /// <summary>
    /// Represents USSD message parameter.
    /// </summary>
    public class MessageParameterViewModel : MessageItemViewModelBase
    {
        private readonly string label;

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageParameterViewModel"/> class.
        /// </summary>
        /// <param name="parameterIndex">Index of the parameter.</param>
        public MessageParameterViewModel(int parameterIndex)
        {
            this.label = string.Format("Parameter {0}:", parameterIndex + 1);
        }

        /// <summary>
        /// Gets the parameter name.
        /// </summary>
        /// <value>
        /// The name of the parameter.
        /// </value>
        public string Label 
        { 
            get
            {
                return this.label;
            } 
        }

        /// <summary>
        /// Gets the text key.
        /// </summary>
        protected override string TextKey
        {
            get
            {
                return Label.Remove(Label.Length - 1);
            }
        }
    }
}
